package com.xinqi.modules.course.demonstrate.controller.inner;

import com.xinqi.common.base.response.R;
import com.xinqi.modules.course.demonstrate.service.DemoHomeworkService;
import com.xinqi.modules.course.demonstrate.service.DemonstrateService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作业基础信息APP接口
 * @author: system
 * @date: 2023/03/08
 */
@Tag(name = "示范课程同步", description = "示范课程同步")
@RestController
@RequestMapping("/inner/demonstrate")
@RequiredArgsConstructor
public class DemonstrateController {

    private final DemonstrateService demonstrateService;

    private final DemoHomeworkService demoHomeworkService;


    /**
     * 新增课程栏目作业信息
     * @Author dzy
     * @Date 10:10 2023/3/9 0009
     * @Return
     */
    @GetMapping("/init")
    public R<Boolean> initDemonstrate(Long userId) {
        return R.ok(demonstrateService.initAllCourse(userId));
    }

    /**
     * 补充作业缺失提交数据
     * @Author dzy
     * @Date 10:10 2023/3/9 0009
     * @Return
     */
    @GetMapping("/supply/homework")
    public R<Boolean> supplyHomework() {
        return R.ok(demoHomeworkService.supplyHomework());
    }

}
